﻿<?xml version="1.0" encoding="utf-8"?>
<component version="1.0" xmlns="http://schemas.circuit-diagram.org/circuitDiagramDocument/2012/component/xml">
  <declaration>
    <meta name="name" value="D Flip-Flop" />
    <meta name="minsize" value="60" />
    <meta name="author" value="Circuit Diagram" />
    <meta name="additionalinformation" value="http://www.circuit-diagram.org/" />
    <meta name="guid" value="06ca73da-1151-4e31-97d6-ccb2108fde23" />
    <meta name="implementset" value="http://schemas.circuit-diagram.org/circuitDiagramDocument/2012/components/common" />
    <meta name="implementitem" value="dflipflop" />
    
    <property name="SetReset" type="bool" default="true" serialize="sr" display="Show set/reset" />
    <flags>
      <option>horizontalonly</option>
      <option>middlemustalign</option>
    </flags>
  </declaration>
  <connections>
    <group>
      <connection name="d" start="_Start-20y" end="_Middle-20x-20y" edge="start" />
      <connection name="ck" start="_Start" end="_Middle-20x" edge="start" />
      <connection name="q" start="_Middle+20x-20y" end="_End-20y" edge="end" />
      <connection name="nq" start="_Middle+20x+20y" end="_End+20y" edge="end" />
    </group>
    <group conditions="$SetReset">
      <connection name="s" start="_Middle-40y" end="_Middle-30y" edge="start" />
      <connection name="r" start="_Middle+30y" end="_Middle+40y" edge="end" />
    </group>
  </connections>
  <render>
    <group>
      <rect x="_Middle-20" y="_Middle-30" width="40" height="60" />
      <line start="_Start" end="_Middle-20x" />
      <line start="_Start-20y" end="_Middle-20x-20y" />
      <line start="_Middle+20x-20y" end="_End-20y" />
      <line start="_Middle+20x+20y" end="_End+20y" />
      
      <!-- Labels -->
      <path start="_Middle-20x-6y" data="l 6,6 l -6,6" thickness="1" />
      <text value="D" x="_Middle-17" y="_Middle-20" align="CentreLeft" size="large" />
      <text value="Q" x="_Middle+17" y="_Middle-20" align="CentreRight" size="large" />
      <line start="_Middle+8x+13.5y" end="_Middle+16x+13.5y" thickness="1" />
      <text value="Q" x="_Middle+17" y="_Middle+20" align="CentreRight" size="large" />
    </group>
    <group conditions="$SetReset">
      <line start="_Middle-40y" end="_Middle-30y" />
      <line start="_Middle+30y" end="_Middle+40y" />
      <text value="S" x="_Middle" y="_Middle-29" align="TopCentre" size="large" />
      <text value="R" x="_Middle" y="_Middle+29" align="BottomCentre" size="large" />
    </group>
  </render>
</component>